//
//  XMBindPhoneViewController.m
//  XMJJ_zml
//
//  Created by apple on 2025/5/9.
//

#import "XMBindPhoneViewController.h"
#import "XMBindPhoneView.h"
#import "XMPhoneCodeViewController.h"
#import "XMNetwork+login.h"

@interface XMBindPhoneViewController ()

@end

@implementation XMBindPhoneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self creatUI];
}

- (void)creatUI {
    XMBindPhoneView *bindPhoneView = [[XMBindPhoneView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:bindPhoneView];
    
    XMWeakSelf;
    bindPhoneView.getCodeBlock = ^(NSString * _Nonnull phoneNum) {
        [weakSelf getCodeWithPhoneNum:phoneNum];
    };
}

- (void)getCodeWithPhoneNum:(NSString *)phoneNumStr {
    XMWeakSelf;
//    [_Network getCodeWithPhoneNum:phoneNumStr
//                             type:@"1"
//                          success:^(id  _Nonnull responseObject) {
        XMPhoneCodeViewController *codeVC = [[XMPhoneCodeViewController alloc] init];
        codeVC.phoneNumStr = phoneNumStr;
        codeVC.codeType = @"1";
        codeVC.accessToken = weakSelf.accessToken;
        codeVC.openId = weakSelf.openId;
        codeVC.unionidStr = weakSelf.unionidStr;
        [self.navigationController pushViewController:codeVC animated:YES];
//    } failure:^(NSError * _Nonnull error) {
//
//    }];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
